home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
038a
/
bprep101.zip
/
BPREP.DOC
< prev
next >
Wrap
Text File
|
1991-09-18
|
19KB
|
713 lines
BPREP
A preprocessor utility for the BASIC language
Version 1.01
[c] 1991 Applied Design Group, E 3707 Pacific, Spokane, WA 99202
(509) 535-7829
Table Of Contents
____________________________________
License Policy 1
Disclaimer 2
Introduction 3
Compatibility 4
Using BPREP 5
The Directives 6
#include 7
#define 8
#undef 10
#ifdef 11
#ifndef 12
#endif 13
Professional Version 14
Registration Information 15
Other Applied Design Group Products 16
Order Form
License Policy: Page 1
BPREP and its documentation are copyright [c] 1991 Applied Design Group
all rights reserved. BPREP may not be circulated in any incomplete
or modified form, nor sold for profit, without written permission
of the author. You may use the unregistered shareware version of
BPREP for a reasonable evaluation period. After the evaluation
period, you must either register BPREP or discontinue its use. If
you register BPREP, you may continue to use the unregistered BPREP
program until you receive the registered version.
If you distribute this software to others, you are required to
distribute the ENTIRE package consisting of the following files:
BPREP.EXE - BASIC Preprocessor
BPREP.DOC - BPREP Documentation
README - Read file
SAMPLE.B - Sample source file
SAMPLE.INC - Sample include file
SAMPLE.BAS - Sample file processed with BPREP
BP.BAT - batch file to run BPREP
Commercial sale:
Any software dealer or library may distribute the entire
BPREP Shareware package in an unmodified form for a fee as long as the
price charged for the disk containing BPREP Shareware does
not exceed US $10.00.
With this single exception, the sale of BPREP or its parts for profit,
either alone or together with other software or hardware, requires a
licensing agreement providing for royalty payments. Please write for
terms.
Disclaimer: Page 2
This software (BPREP Shareware) is provided on an "as is" basis without
warranty of any kind, expressed or implied, including but not limited
to the implied warranties of merchantability and fitness for a
particular purpose. The person using the software bears all risk as to
the quality and performance of the software. Should the software
prove defective, the user assumes the entire cost of all necessary
repair, servicing, or correction. The author will not be liable for
any special, incidental, consequential, indirect or similar damages
due to loss of data or any other reason, even if the author or an
agent of the author has been advised of the possibility of such
damages. In no event shall the author's liability for any damages
ever exceed the price paid for the license to use the software,
regardless of the form of the claim.
Introduction Page 3
BPREP 1.01
BPREP is a preprocessor for the BASIC language. It adds features
usually lacking in most versions of BASIC. With BPREP you can have
conditional compilation, include files and defined constants. If you are
a C programmer you will probably recognize the syntax. If you have never
used a preprocessor before you will soon be wondering how you ever got
along without one. This is a shareware product, you may try BPREP to see
if it fits your needs. If after a reasonable period of time you find you
are still using BPREP you must register. By registering this product
you will receive the professional version which includes many additional
features you will also recieve a printed manual, technical support and
a subscription to our quarterly newsletter for one year.
Alternatively you may register the version which you have at a lower
cost and recieve the printed manual and technical support.
Compatibility Page 4
BPREP can be used with almost any BASIC product that can take input from
a normal ascii file. This includes but is not limited to the following.
Turbo Basic
Power Basic
QuickBasic 3.0
QuickBasic 4.0
QuickBasic 4.5
GW Basic
MEQ Basic (Mars Electronics)
Intel MCS BASIC 52
If there is a question of compatibility just drop us a line or call
8:00 AM to 5:00 PM Pacific Time.
Applied Design Group
(509) 535-7829
Using BPREP Page 5
BPREP takes two arguments from the command line, an input file name and
an output file name. We suggest using "B" as an extension for your
source files and "BAS" for the output files, although anything will work
ie:
BPREP myfile.b myfile.bas
myfile.b :
#define SUM 3+4
print SUM
myfile.bas
print 3+4
so the command line syntax is
BPREP infile outfile
if you leave off the outfile name BPREP will write to the screen, useful
to see what's going on.
#defined names must start with a letter and can consist of numbers,
letters and the underscore "_" character. Length of names is limited by
memory and common sense.
Valid names
-----------
TEST_1
Version1
Version_1_2_3
DISTRIB
Abcdefgjijklmnopqrstuvwxyz1234567890_____________
Page 6
The Directives
BPREP shareware supports the following directives:
#include
#define
#undef
#ifdef
#ifndef
#endif
#include Page 7
SYNTAX : #include myfile.inc
OPERATION : The #include directive does not allow quotes around the file
The included file will be opened and processed and can
include preprocessor directives. The ouput will be a single
combined file of all included files. Include files can
be nested to a depth of 4 in the SHAREWARE version. In the
PROFESSIONAL version the number of include files is
limited only by available memory and disk space.
#define Page 8
SYNTAX : #define name definition
OPERATION : The define directive allows you to replace constants with
meaningful symbolic names and to define symbols to be
used with the conditional compilation directives (see
below). The name can be any legal basic variable name
although we suggest using upper case names for defined
constants and lower and uppercase mixture or lowercase
only for variables. ie
#define COMM_PORT 1000
current_comm_port = COMM_PORT
In the shareware version of BPREP definitions are limited
to string constants so the following:
#define SUM 3+4
sumvar = SUM + 6
will translate to:
sumvar = 3+4 + 6
Any text in string literals or comments is left
completely intact:
#define DEFINE "#define"
print DEFINE
becomes:
print "#define"
Page 9
Names cannot be defined twice to change the value of a
#define'd name #undef it first.
#define SUM 3+4
#define SUM 4+5 --- ERROR
#define SUM 3+4
#undef SUM
#define SUM 4+5 --- OK
Names can be used in the expression of a #define
statement.
ie:
#define FIRSTNAME "John"
#define LASTNAME "Smith"
#define NAME FIRSTNAME + " " + LASTNAME
name$ = NAME
becomes:
name$ = "John"+" "+"Smith"
If constant expression evaluation is a feature you
would like to have then consider purchasing the
professional version.
ie: (in the PROFESSIONAL VERSION ONLY )
#define SUM 3+4
var = SUM : becomes var = 7
#undef Page 10
SYNTAX : #undef name
OPERATION : The name is removed from the symbol table further
references to the name will be ignored. Use the
#undef directive to redefine a #defined'd name.
#ifdef Page 11
SYNTAX : #ifdef name
...
...
#endif
OPERATION : The #ifdef directive is used for conditional compilation
if the name is found the code up until the #endif
directive is emmitted to the output file, if the symbol
is not found then no code is emmitted until the #endif is
reached.
example:
#define VER1
#ifdef VER1
print "My Program Ver 1.0"
#endif
#ifdef VER2
print "My Program Ver 2.0"
#endif
output:
My Program Ver 1.0
The shareware version allows #ifdef's and #ifndefs
to be nested to 8 levels
ie:
#ifdef VER1
#ifdef UPDATE1
print "My Program Ver 1.0 update 1.0"
#endif
#endif
if deeper nesting is required the professional version
allows virtually unlimited nesting.
#ifndef Page 12
SYNTAX : #ifndef name
...
...
#endif
OPERATION : The #ifndef directive is used for conditional compilation
if the name is not found the code up until the #endif
directive is emmitted to the output file, if the symbol
is found then no code is emmitted until the #endif is
reached.
#endif Page 13
SYNTAX : #endif
OPERATION : #endif terminates an #ifdef or #ifndef block
Professional Version Page 14
The professional version includes the following additional features:
Constant expression evaluation : defines can be arithmetic expressions
as well as strings.
Nested conditional directives : unlimited nesting of #ifdef,
#ifndef, etc.
Case sensitivity switch, case sensitive code generation.
Line number generation for line number basics.
The following additional directives:
#if
#else
#elseif
#repeat
#macro
#endm
#local
#display
#error
#fatal
#date
#time
#conds
#noconds
#defs
#nodefs
Registration Information Page 15
BPREP is NOT FREE Software. If you wish to continue using BPREP
you must register.
Q : What do I get if I register ?
A : BPREP Shareware is a complete and usable program as is
however, by registering you will recieve the latest version
of BPREP Professional the enhanced BASIC Preprocessor which
includes many additional features not found in
BPREP Shareware. So this is what you will recieve
- BPREP Professional on disk
- A Printed manual
- Unlimited Technical Support
- Quarterly Newsletter
(for 1 year)
$24.95
Q : I'd like to register for the technical support and manual
but I don't need the power of BPREP Professional.
A : You can register your copy of BPREP Shareware and receive
the printed manual and technical support for only:
$9.95.
Other Applied Design Group Products Page 16
ASM51 8051/8031 Macro Cross Assembler
A full featured Cross Assembler for the Intel 8051/8031
series of microprocessors. Generates Intel HEX files or
binary image output.
$39.95
BAS51 8051/8031 Basic Cross Compiler
A BASIC compiler for the 8051 that supports most features
of the BASIC language. Use structured contstructs
while/wend, do/loop, block if/then. Generates good tight
code and no line numbers are required. Get those 8051
projects done in less time.
$99.95
BAS51 Professional
A complete package including BAS51 Compiler, ASM51 Assembler
and BPREP Professional, as well as several other utilities to
help you write 8051 code.
$149.95
BPREP version 1.01 Order Form
-----------------------------------------------------------------
Make checks payable to:
Applied Design Group
E 3707 Pacific
Spokane, WA 99202
-----------------------------------------------------------------
Qty
[ ] BPREP Shareware @ $9.95 each $______
[ ] BPREP Professional @ $24.95 each $______
[ ] ASM51
8051/8031 Macro Cross Assembler @ $39.95 each $______
[ ] BAS51
8051/8031 Basic Cross Compiler @ $99.95 each $______
[ ] BAS51 Professional
8051/8031 Basic Cross Compiler
Includes Macro Assembler
and BPREP Professional @ $149.95 each $______
Subtotal $______
Washington residents please add 8.0% sales tax. $______
Shipping and handling $3.50
Total $______
Diskette type : [ ] 5.25" [ ] 3.5"
Payment : [ ] Check [ ] Money Order
Checks and Money Orders must be drawn on U.S. banks in U.S. funds
-----------------------------------------------------------------
Name _______________________________________________________
Company _______________________________________________________
Address _______________________________________________________
_______________________________________________________
Phone _____________________ Business ______________________
Where did you obtain BPREP?
_______________________________________________________
Comments _______________________________________________________
_______________________________________________________